//
//  TTURLSessionManager.h
//  01-AFN
//
//  Created by peironggao on 2017/10/14.
//  Copyright © 2017年 gaopeirong. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface TTURLSessionManager : NSObject

+ (instancetype)shareInstance;

#pragma mark - json response 请求
- (NSURLSessionDataTask *)getRequestWithURLString:(NSString *)urlString
                                           params:(NSDictionary *)params
                                          success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
                                          failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;

- (NSURLSessionDataTask *)postRequestWithURLString:(NSString *)urlString
                                            params:(NSDictionary *)params
                                           success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
                                           failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;


#pragma mark - http response 请求
- (NSURLSessionDataTask *)postHttpResponseRequestWithURLString:(NSString *)urlString
                                                        params:(NSDictionary *)params
                                                       success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
                                                       failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;

- (NSURLSessionDataTask *)getHttpResponseRequestWithURLString:(NSString *)urlString
                                                       params:(NSDictionary *)params
                                                      success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
                                                      failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;

@end
